#include "devices_buzzer.h"
#include "system_delay.h"
#define time1 50 
#define hz1 1 

void devices_buzzer_init(void)
{
RCC ->APB2ENR |= (1<< 3);
	GPIOB ->CRL &= ~( 15 << 20);
  GPIOB ->CRL |= ( 1 << 21);
}

void devices_buzzer_solo1(void){
    uint16_t i;
    for(i=0;i<time1;i++){
       GPIOB ->ODR &=~( 1 << 5);
       system_delay_ms(hz1); 
        GPIOB ->ODR |=( 1 << 5);
        system_delay_ms(hz1); 
    }
}
#define time2 100 
#define hz2 500 
void devices_buzzer_solo2(void){
    uint16_t i;
    for(i=0;i<time2;i++){
       GPIOB ->ODR &=~( 1 << 5);
       system_delay_us(hz2); 
        GPIOB ->ODR |=( 1 << 5);
        system_delay_us(hz2); 
    }
}